package org.spring.springboot.controller;


@RestController
@RequestMapping(value = "/activity", produces="application/json")
public class ActivityController {



	    /**
     * 活动页banner
     * @return
     */
    @RequestMapping(value = "/adv")
    public String adv() {
        List<Map<String,Object>> adv = service.getAdvList();
        return JSONValue.toJSONString(new Handle(200, "成功", adv));
    }
   
   
       @RequestMapping("/sumactivity")
    public String sumActivity(@ModelAttribute("data")Activity act){
        List<Map<String, Object>> sumActivityInfo = this.service.sumActivityInfo(act);
        return JSONValue.toJSONString(new Handle(200,"操作成功",sumActivityInfo));
    }
	
	    @RequestMapping("/findActivity")
    public String findActivity(Activity activity){
        Map<String, Object> activity1 = service.findActivity(activity);
        return JSONValue.toJSONString(new Handle(200,"操作成功",activity1));
    }
   
       @RequestMapping("/sumactivity")
    public String sumActivity(@ModelAttribute("data")Activity act){
        List<Map<String, Object>> sumActivityInfo = this.service.sumActivityInfo(act);
        return JSONValue.toJSONString(new Handle(200,"操作成功",sumActivityInfo));
    }
	
	    @RequestMapping("/getprovince")
    public String getprovince(){
        Map<String, Object> map = new HashMap<>();
        List<Map<String, Object>> provincelist = this.service.provinceList();
        map.put("provincelist",provincelist);
        List<Map<String, Object>> monthcount = this.service.countActivity();
        map.put("monthcount",monthcount);
        List<Map<String, Object>> orgcount = this.service.countOrg();
        map.put("orgcount",orgcount);
        List<Map<String, Object>> activityList = this.service.activityList();
        map.put("activityList",activityList);
        return JSONValue.toJSONString(new Handle(200,"操作成功",map));
    }

    @RequestMapping("/searchactivitylist")
    public String searchactivitylist(@ModelAttribute("data")Activity act){
        Map<String, Object> searchactivitylist = this.service.searchActivityList(act);
        return JSONValue.toJSONString(new Handle(200,"操作成功",searchactivitylist));
    }
	
	    @RequestMapping("/findActivity")
    public String findActivity(Activity activity){
        Map<String, Object> activity1 = service.findActivity(activity);
        return JSONValue.toJSONString(new Handle(200,"操作成功",activity1));
    }
	
	    @RequestMapping("/activityinfoMap")
    public void activityinfoMap(@ModelAttribute("data")Activity act){
        System.out.println("净摊地图活动详情浏览数");
    }


}
